﻿<s:SurfaceWindow x:Class="Samples.CanvasScatterView.SurfaceWindowMain"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:s="http://schemas.microsoft.com/surface/2008"
                 xmlns:tk="clr-namespace:Black.SurfaceToolkit.Controls;assembly=Black.SurfaceToolkit"
                 Title="Samples.CanvasScatterView">
    <s:SurfaceWindow.Resources>
        <ImageBrush x:Key="WindowBackground" Stretch="None" Opacity="0.6" ImageSource="pack://application:,,,/Resources/WindowBackground.jpg" />
        
        <Style x:Key="ContentControlStyle" TargetType="{x:Type ContentControl}">
            <Setter Property="Width" Value="150" />
            <Setter Property="Height" Value="100" />
            <Setter Property="Background" Value="LightGray" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ContentControl}">
                        <Border Width="{TemplateBinding Width}" 
                                Height="{TemplateBinding Height}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="DarkGray"
                                BorderThickness="1" CornerRadius="3">
                            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                                <TextBlock Text="LevelOfView" TextAlignment="Center" VerticalAlignment="Center" Foreground="Black" />
                                <TextBlock Text="{TemplateBinding Content}" TextAlignment="Center" VerticalAlignment="Center" Foreground="Black" FontSize="28" />
                            </StackPanel>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
    </s:SurfaceWindow.Resources>

    <Grid Background="{StaticResource WindowBackground}" Width="1024" Height="768">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
               
        <!-- CanvasScatterView -->
        <tk:CanvasScatterView x:Name="usrCanvasScatterView" 
                               Grid.Column="1" 
                               CanMove="{Binding ElementName=scbCanMove, Path=IsChecked}"
                               CanRotate="{Binding ElementName=scbCanRotate, Path=IsChecked}"
                               CanScale="{Binding ElementName=scbCanScale, Path=IsChecked}"
                               IsInertiaEnabled="{Binding ElementName=scbInertia, Path=IsChecked}"
                               IsFlingOutEnabled="{Binding ElementName=scbFlingOut, Path=IsChecked}">

            <ContentControl Style="{StaticResource ContentControlStyle}" Content="0" />
            <ContentControl Style="{StaticResource ContentControlStyle}" Content="0" />
            <ContentControl Style="{StaticResource ContentControlStyle}" Content="0" />
            <ContentControl Style="{StaticResource ContentControlStyle}" Content="0" />
            <ContentControl Style="{StaticResource ContentControlStyle}" Content="0" />
            <ContentControl Style="{StaticResource ContentControlStyle}" Content="0" />
        
        </tk:CanvasScatterView>
        
        <!-- Volet Gauche CanvasScatterView parameters -->
        <StackPanel Background="LightGray" HorizontalAlignment="Left" VerticalAlignment="Center">
            <s:SurfaceCheckBox x:Name="scbCanMove" Content="CanMove" IsChecked="True" />
            <s:SurfaceCheckBox x:Name="scbCanRotate" Content="CanRotate" IsChecked="True" />
            <s:SurfaceCheckBox x:Name="scbCanScale" Content="CanScale" IsChecked="True" />
            <s:SurfaceCheckBox x:Name="scbInertia" Content="Inertia" IsChecked="True" />
            <s:SurfaceCheckBox x:Name="scbFlingOut" Content="FlingOut" IsChecked="True" />
            <s:SurfaceCheckBox x:Name="scbLevelOfView" Content="LevelOfView" IsChecked="False" Checked="scbLevelOfView_Checked" Unchecked="scbLevelOfView_Unchecked" />
            <s:SurfaceButton x:Name="sbtnAddItem" Content="Ajouter Item" Click="sbtnAddItem_Click" />
        </StackPanel>
        
    </Grid>
</s:SurfaceWindow>
